import { RouteObject } from 'config/routes';

export default [
  {
    name: '权限演示',
    path: '/access/test',
    component: '@/pages/Access',
    //  有access键，会运行access.ts文件中的 routeAccess方法，返回true才会显示该路由
    access: 'routeAccess',
    accessKey: 'access-test',
  },
  {
    name: '权限演示详情',
    path: '/access/test/detail/:id',
    component: '@/pages/Access/Detail',
    hideInMenu: true,
    accessKey: 'access-test-detail',
    access: 'routeAccess',
    meta: {
      showBack: true,
    },
  },
  {
    name: '三级嵌套权限',
    path: '/access/deep',
    component: '@/pages/Access/Detail',
    accessKey: 'access-deep',
    access: 'routeAccess',
    routes: [
      {
        name: '三级嵌套权限-1',
        path: '/access/deep/level1',
        accessKey: 'access-deep-level1',
        access: 'routeAccess',
        routes: [
          {
            name: '三级嵌套权限-1的子节点',
            path: '/access/deep/level1/comp1',
            accessKey: 'access-deep-level1-comp1',
            access: 'routeAccess',
            component: '@/pages/Access/Detail',
          },
          {
            name: '三级嵌套权限-1的子节点2',
            path: '/access/deep/level1/comp2',
            accessKey: 'access-deep-level1-comp2',
            access: 'routeAccess',
            component: '@/pages/Access/Detail',
          },
        ],
      },
      {
        name: '三级嵌套权限-2',
        path: '/access/deep/level2',
        accessKey: 'access-deep-level2',
        access: 'routeAccess',
        component: '@/pages/Access/Detail',
      },
    ],
  },
] as RouteObject[];
